const noticeApi = {
    /**
     * 消息列表
     *
     * @returns {Promise<NoticeListResponse[]>}
     * @author zero
     */
    lists(params: {
        page_no?: number;
        page_size?: number;
    }): Promise<NoticeListResponse[]> {
        return $request.get<NoticeListResponse[]>({
            url: '/notice/lists',
            params
        })
    },

    /**
     * 标记已读
     *
     * @param {number} [id]
     * @returns {Promise<void>}
     * @author zero
     */
    read(id?: number): Promise<void> {
        return $request.post({
            url: '/notice/read',
            params: { id }
        })
    },

    /**
     * 标记删除
     *
     * @param {number} [id]
     * @returns {Promise<void>}
     * @author zero
     */
    delete(id?: number): Promise<void> {
        return $request.post({
            url: '/notice/delete',
            params: { id }
        })
    }
}

export default noticeApi